<template>
    <div>
        <input type="text" v-model="state.MPhone">
        <input type="date" v-model="state.CreateTime">
        <input type="date" v-model="state.MBirth">
        <input type="button" value="查询"  @click="MemberShow"/>
     <table>
        <tr>
            <td>电话</td>
            <td>注册时间</td>
            <td>出生日期</td>
            <td>操作</td>
        </tr>
        <tr v-for="item in list">
            <td>{{ item.mPhone }}</td>
            <td>{{ item.createTime }}</td>
            <td>{{ item.mBirth }}</td>
            <td> <input type="button" value="删除"/></td>
        </tr>
     </table>
    </div>
</template>

<script setup lang="ts">
import { reactive,toRefs, onMounted} from 'vue'
import {useRoute,useRouter} from 'vue-router'
import axios from 'axios'
const route = useRoute()
const router = useRouter()

const data:any=reactive({
    state:{
        MPhone:'',
        CreateTime:'',
        MBirth:''
    },
   list:[]
})

const { list,state } = toRefs(data)

onMounted(()=>{
   MemberShow();
})
const MemberShow = () => {
   axios({
    url:'https://localhost:7144/api/Login/ShowMember',
    method:'get',
    params:state.value
   }).then((res)=>{
      list.value = res.data.data
   })
   .catch((err)=>{
      console.log(err);
   })
}
</script>

<style scoped>

</style>